package org.particles.common;

public class CommonUtil {
	private static int uniqueIndex = 1;
	private static long uniqueBitExp = 0;
	
	public static int roundToInt(double d) {
		return (int) Math.round(d);
	}
	
	/**
	 * @return in this application runtime unique index.
	 */
	public static int uniqueIndex() {
		return uniqueIndex++;
	}
	
	/**
	 * @return in this application runtime unique bit.
	 */
	public static long uniqueBit() {
		return roundToInt(Math.pow(2, uniqueBitExp++));
	}
}
